Skip to main content

Cypress UI Automation - part 3

 

Cross Browser Testing

BrowserStack implementation

I created a local git branch using Visual studio code, then installed BrowserStack as follows:

Firstly install it on the command line :

npm install -g BrowserStack-cypress-cli --save-dev

Setup the BrowserStack credentials to use by initiating the browserstack.json file as follows:

BrowserStack-cypress init

If this does not work, right-click the cypress folder, create a new file as BrowserStack-cypress.json.

I executed the following command.

npm run test:first. To run the BrowserStack tests. Below is a screenshot of the browserstack.json file.






Code in the package.json file to execute the BrowserStack tests:





In the change, I have edited the baseUrl with the –env env=stg, pointing it to the environment file which contains details of the test environment that loads the test pages/websites. Then I specified details of a test spec file.

I executed the test command resulting in a successful execution –








Errors after the test execution –






I examined the error and realised it was due to an automation error.

After I made changes to the automation script, I executed the command –‘npm run browserstack:tests’ to run BrowserStack again and all tests passed -.





In the above screenshot, you can view a video of the tests, which is fantastic and very convenient to watch and perhaps analyse any problems along the way. At the top, you get all the details for the operating system (OS) as WINDOWS 10, and browser as CHROME.  

 

I used details such as popular devices and browsers from our Google analytics to design the browserstack.json settings -




View part - 4 - Visual Testing, here.



Thank you for visiting my website.

































Comments

Popular posts from this blog

Working with Dropdownbox elements in Selenium WebDriver

How to select element from a Dropbox We are going to use Selenium webDriver and chrome driver to test this. In addition, this test was created on Mac.  I assume you have installed and setup java in your system path.  Also, install Eclipse for jee. 1. First let's take a look at a quick test case: Test case: TC_1. Register on http://automationpractice.com/index.php TC_1.1: Launch hope page -http://automationpractice.com/index.php TC_1.2 : Click on link ‘Sign in’ TC_1.3 : Under “Create Account” subheading, enter Email address in ‘Email address’ textfield TC_1.4 : Click on ‘Create an account’ button. —————————————————————————————— Test data: Email address: gorgeous12@hotmail.com http://automationpractice.com/index.php ---------------------------------------------------------------- Expected : http://automationpractice.com/index.php?controller=my-account ———————————------------ 2. Next, create a maven project in Eclipse 3....

Cypress UI Automation - part 1

Java to Cypress-JavaScript Automation Migration Introduction: Across Cancer Research UK engineering department, we currently use a Java automation framework for our User interface and API testing. The framework has evolved in the last 3 to 4 years and currently, we have 19 products/project, (running approximately 1350 test scenarios) using the framework to run the respective sanity/regression packs. The project/products extend across different technology stacks such as Drupal, Symphony, React JS, .Net, OBI and Siebel CRM.   The Quality Assurance (QA) test team are currently under the process to be transformed into a fully-fledged Quality Assurance function.   As part of this transformation, we would like to have a comprehensive, automated test suite that can be maintained by developers and testers. Furthermore, our front-end web development is moving into JavaScript, now is the right time to migrate our automation framework also from java into JavaScript. The introduction ...

Performance Testing

  Performance Testing As part of the Quality Assurance Test Approach, each tester has to implement performance testing within its product team. In this section of the project, I will be using Apache JMeter as the testing tool for the test approach. Apache JMeter is an open-source performance testing tool for load, stress and many more testing. Screenshot from: https://www.youtube.com/watch?v=817zU_bXh9Y&list=PLUDwpEzHYYLs33uFHeIJo-6eU92IoiMZ7 JMeter works by creating a request to a target server(website), the server then responds, saves responses, collects, calculate statistics, return results to request and then generate reports.